import { createStore } from 'vuex'

export default createStore({
  state: {
    myOrderList: JSON.parse(localStorage.getItem('myOrderList')) || []
  },
  mutations: {
    setMyOrderList (state, list) {
      state.myOrderList.push(list)
    },
    setStorage (state) {
      localStorage.setItem('myOrderList', JSON.stringify(state.myOrderList))
    },
    removeMyOrder (state, index) {
      state.myOrderList.splice(index, 1)
    }
  },
  actions: {

  },
  modules: {

  },
  getters: {

  }
})
